package bagu.set;

import java.util.HashMap;
import java.util.Map;
import java.util.SortedMap;

public class MapDemo {
    public static void main(String[] args) {
        Map<String, Integer> map = new HashMap<>();
        map.put("A", 1);
        map.put("B", 2);
//        for(Map.Entry<String, Integer> entry : map.entrySet())
//            System.out.println("Key : " + entry.getKey() + "," + "Value:" + entry.getValue());
//        for(String key : map.keySet())
//            System.out.println("key :" + key);
        map.forEach((key, value)->{
            System.out.println("Key : " + key + "," + "Value:" + value);
        });

    }
}
